<template>
  <div class="container" style="min-height: 100%; padding-bottom: 100px;">
    Hello，欢迎使用LCG，请往此区域拖拽组件
    <div>{{ showText }}</div>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="100px"
      class="demo-border"
    >
      <el-upload
        class="upload-demo"
        action="https://localhost:10086/utils/upload">
        <el-button size="small" type="primary">点击上传</el-button>
        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
      </el-upload>
    </el-form>
  </div>
</template>

<script>
export default {
  props: [],
  components: {},
  data () {
    return {
      ruleForm: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      rules: {
        name: [
          {
            required: true,
            message: '请输入活动名称',
            trigger: 'blur'
          },
          {
            min: 3,
            max: 5,
            message: '长度在 3 到 5 个字符',
            trigger: 'blur'
          }
        ],
        region: [
          {
            required: true,
            message: '请选择活动区域',
            trigger: 'change'
          }
        ],
        date1: [
          {
            type: 'date',
            required: true,
            message: '请选择日期',
            trigger: 'change'
          }
        ],
        date2: [
          {
            type: 'date',
            required: true,
            message: '请选择时间',
            trigger: 'change'
          }
        ],
        type: [
          {
            type: 'array',
            required: true,
            message: '请至少选择一个活动性质',
            trigger: 'change'
          }
        ],
        resource: [
          {
            required: true,
            message: '请选择活动资源',
            trigger: 'change'
          }
        ],
        desc: [
          {
            required: true,
            message: '请填写活动形式',
            trigger: 'blur'
          }
        ]
      },
      showText: '这里的值声明于预设JS代码',
      showValue: '开启预览模式后,点击我显示预设逻辑'
    }
  },
  watch: {},
  computed: {},
  beforeCreate () {
  },
  created () {
  },
  beforeMount () {
  },
  mounted () {
  },
  beforeUpdate () {
  },
  updated () {
  },
  destroyed () {
  },
  methods: {
    request () {
    },
    hello () {
      alert('来自预设逻辑代码的问候')
    }
  },
  fillter: {}
}
</script>

<style scoped>
.el-icon--right {
}

.el-icon-upload {
}

.container {
}

.demo-border {
  border: 1px grey dashed;
  min-height: 1rem;
  border-radius: 5px;
}
</style>
